﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Template.Master" Inherits="System.Web.Mvc.ViewPage<JLL.China.Model.Listings>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
 <div id="page-heading">
  <h1>
            <a class="icons icon-circle-arrow-right"></a> <b><span class="show-listing"> 
            <%=ViewData["HeadingMsgStep1"].ToString()%>
              </span> </b>
        </h1>
        <h1>Manage Property Listings </h1>
    </div>
    <div class="menu-nav">
         <% Html.RenderPartial("TopMenu");%>
       
    </div>
     <!-- end page-heading -->
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowleft.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
            <th class="topleft">
            </th>
            <td id="tbl-border-top">
                &nbsp;
            </td>
            <th class="topright">
            </th>
            <th rowspan="3" class="sized">
                <img src="<%=Url.Content("~/Content/images/shared/side_shadowright.jpg")%>" width="20"
                    height="300" alt="" />
            </th>
        </tr>
        <tr>
            <td id="tbl-border-left">
            </td>
            <td>
                <!--  start content-table-inner ...................................................................... START -->
                <div id="content-table-inner">
                    <div id="tab-language">
                    <%--    <ul id="tabs1" class="tabs">
                            <% string languegeID = ViewData["LanguageID"].ToString();
                                    string activecssen = "";
                                    string activecsscn = "";
                                    if (languegeID == "1")
                                    {
                                        activecssen = "class='active'";
                                    }
                                    if (languegeID == "2")
                                    {
                                        activecsscn = "class='active'";
                                    }  
                             %>
			                <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1/<%=(this.Model != null) ? this.Model.ID.ToString() : "" %>?Language=EN"<%=activecssen%>>English</a></li>
			                <li><a href="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1/<%=(this.Model != null) ? this.Model.ID.ToString() : "" %>?Language=CN" <%=activecsscn%>>Chinese</a></li>
			               
		                </ul>--%>
		                 <!--  start message-blue -->
                         <% Html.RenderPartial("Measage");%>     
                          <!--  end message-blue -->
                    </div>
                  
                   <!--  start step-holder -->
                    <%Html.RenderPartial("StepHolder", (this.Model != null) ? this.Model.ID.ToString() : null); %>
                    <!-- start id-form -->
                    <form action="<%=Url.Content("~/")%><%=ViewData["now_controller"]%>Step1/" class="validateforms" id="formID" method="post">
                    <input type="hidden" value="<%=ViewData["LanguageID"]%>" name="LanguageFID"/>
                    <input type="hidden" value="<%=(this.Model != null) ? this.Model.ID.ToString() : "" %>" name="ListingID"/>
                    <input type="hidden" value="<%=ViewData["ListingType"]%>" name="ListingType"/>
                    <input type="hidden" value="<%=ViewData["IsLocal"]%>" name="IsLocal"/>
                    <input type="hidden" value="<%=ViewData["ListingSource"]%>" name="ListingSource"/>

                    <%Html.RenderPartial("Form",this.Model); %>
                    </form>
                </div>
                  <!--  end table-content  -->
            </td>
            <td id="tbl-border-right">
            </td>
        </tr>
        <tr>
            <th class="sized bottomleft">
            </th>
            <td id="tbl-border-bottom">
                &nbsp;
            </td>
            <th class="sized bottomright">
            </th>
        </tr>
    </table>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="CSS" runat="server">
   <% Html.RenderPartial("Css"); %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="JS" runat="server">
   <% Html.RenderPartial("Js"); %>
   <script src="<%=Url.Content("~/Scripts/Run.js")%>" type="text/javascript"></script>
   <script src="<%=Url.Content("~/Scripts/underscore-min.js")%>" type="text/javascript"></script>
   <script type="text/javascript">
       $(document).ready(function() {

           $("#vmProjectName").bind("change", function() {
               var proID = $(this).val();
               if (proID != "") {

                   $("#content-outer").showLoading();
                   //Call server
                   $.getJSON(BASE_URL + "Listings/Ajax/GetProjectDirectory/" + proID, function(result) {
                       var projectModel = ko.mapping.fromJS(result.Data);
                       //Fill Data
                       // change project name
                       $("#PropertyClsssm").val(projectModel.PropertyClsssm()).trigger("liszt:updated");
                       //Property Type

                       $("#vmPropertyType").val(projectModel.PropertyTypeFID()).trigger("liszt:updated");
                       //City+Location+Subarea
                       $("#vmCity").val(projectModel.CityFID()).trigger("liszt:updated");
                       locationselected = projectModel.LocaltionFID();
                       subareaselected = projectModel.SubAreaFID();
                       $("#vmCity").trigger("change");
                       $("#vmLocation").trigger("change");
                       $("#vmLocation").val(locationselected).trigger("liszt:updated");
                       $("#vmSubarea").val(subareaselected).trigger("liszt:updated");
                       $("#vmLocation").trigger("change");
                       //Streetname
                       $("#vmStreetName").val(projectModel.StreetNameFID()).trigger("liszt:updated");
                       //Tenure
                       $("#tenure").val(projectModel.Tenure());
                       //Description
                       $("#description").val(projectModel.Description());
                       $("#descriptionlocal").val(projectModel.DescriptionLocal());
                       //House number
                       $("#HouseNumber").val(projectModel.HouseNumber());
                       //Features
                       /*
                       var Features = (projectModel.Features());
                       $("#vmFeature li input").removeAttr("checked");
                       $("#vmFeature li input").each(function() {
                       var valseach = $(this).val();
                       if (Features.search(valseach) != -1) {
                       $(this).attr("checked", "checked");
                       }
                       });
                       //Facilities
                       var Facilities = (projectModel.Facilities());
                       $("#vmFacilities li input").removeAttr("checked");
                       $("#vmFacilities li input").each(function() {
                       var valseach = $(this).val();
                       if (Facilities.search(valseach) != -1) {
                       $(this).attr("checked", "checked");
                       }
                       });*/
                       $("#content-outer").hideLoading();
                   });

               }

           });

       });
   </script>
</asp:Content>
